Module for matrix decomposition methods
This module provides subroutines for various matrix decomposition methods including LU, LDU, Cholesky, and QR decompositions.
forward algorithm, solves the system where L is a lower triangular matrix and b is a vector
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | L | ||
real(kind=dp), | intent(in), | DIMENSION(:) | :: | b |
backward algorithm, solves the system where U is an upper triangular matrix and y is a vector
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | U | ||
real(kind=dp), | intent(in), | DIMENSION(:) | :: | y |
LU decomposition of a matrix A This subroutine performs LU decomposition of a given matrix A, where L is a lower triangular matrix and U is an upper triangular matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1),SIZE(A, 1)) | :: | L | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1),SIZE(A, 1)) | :: | U |
LDU decomposition of a matrix A This subroutine performs LDU decomposition of a given matrix A, where L is a lower triangular matrix, D is a diagonal matrix, and U is an upper triangular matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1),SIZE(A, 1)) | :: | L | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1),SIZE(A, 1)) | :: | D | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1),SIZE(A, 1)) | :: | U |
Incomplete LU decomposition of a matrix A This subroutine performs incomplete LU decomposition of a given matrix A, where L is a lower triangular matrix and U is an upper triangular matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1), SIZE(A, 1)) | :: | L | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1), SIZE(A, 1)) | :: | U |
Cholesky decomposition of a matrix A This subroutine performs Cholesky decomposition of a given symmetric positive definite matrix A, where L is a lower triangular matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(: ,:) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1), SIZE(A, 1)) | :: | L |
Alternative Cholesky decomposition of a matrix A This subroutine performs alternative Cholesky decomposition of a given symmetric positive definite matrix A, where L is a lower triangular matrix and D is a diagonal matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1), SIZE(A, 1)) | :: | L | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1), SIZE(A, 1)) | :: | D |
Incomplete Cholesky decomposition of a matrix A This subroutine performs incomplete Cholesky decomposition of a given matrix A, where L is a lower triangular matrix and U is an upper triangular matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1), SIZE(A, 1)) | :: | L |
QR decomposition of a matrix A using various methods This subroutine performs QR decomposition of a given matrix A using the specified method (Householder, Givens, Classical Gram-Schmidt, or Modified Gram-Schmidt). The output matrices Q is an orthogonal matrix and R is an upper triangular matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
character(len=*), | intent(in), | optional | :: | method | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | Q | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | R |
QR decomposition using Householder method
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | Q | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | R |
QR decomposition using Givens rotations
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | Q | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | R |
QR decomposition using Classical Gram-Schmidt method
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | Q | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | R |
QR decomposition using Modified Gram-Schmidt method
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:, :) | :: | A | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | Q | ||
real(kind=dp), | intent(out), | DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) | :: | R |